package now_coder.dp.ncs;

public class NC152 {

    public int divideNumber (int n, int k) {
        // write code here
        int[][] dp = new int[n + 1][k + 1];

        for (int i = 1; i <= n; i++) {
            dp[i][1] = 1;
        }

        for (int i = 2; i < dp.length; i++) {
            for (int j = 2; j <= k; j++) {
                if (j > i)
                    break;
                dp[i][j] = dp[i - j][j] + dp[i - 1][j - 1];
            }
        }

        return dp[n][k];
    }

    public static void main(String[] args) {
        System.out.println(new NC152().divideNumber(7, 3));
    }

}
